package com.study.custom.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.study.custom.R;
import com.study.custom.view.ZheXianTuView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button btnZheXian;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
        initListener();
    }

    private void initView() {
        btnZheXian = findViewById(R.id.btn_broken);
    }

    private void initListener() {
        btnZheXian.setOnClickListener(this);
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_broken:
                goIntent(ZheXianTuActivity.class);
                break;
        }
    }

    private void goIntent(Class cla) {
        Intent intent = new Intent(MainActivity.this, cla);
        startActivity(intent);
    }
}
